package name.huzhenbo.java.patterns.memento;

class Increaser {
    private int count;
    private IncreaserMementor mementor = new IncreaserMementor();

    public Increaser(int count) {
        this.count = count;
    }

    public void increase(int added) {
        mementor.addMem(added);
        count += added;
    }

    public int current() {
        return count;
    }

    public void unexecute() {
        count -= mementor.decreaseMem();
    }
}
